package disjunction.examples.entities
{
	import disjunction.core.*;
	import disjunction.core.geom.Cuboid;
	import disjunction.core.geom.Vector2;
	import disjunction.core.geom.Vector3;
	
	import flash.geom.Rectangle;

	/**
	 *
	 *
	 * @author Nick Wiggill
	 */
	
	public class DemoEntityModel implements ISpatial2D
	{
		//Variables with upper case names are excluded from serialisation.
		public static const TYPE_BOUNCER:uint = 0;
		public static const TYPE_DANCER:uint = 1;
		public static const TYPE_WANDERER:uint = 2;
		public static const TYPE_JITTERER:uint = 3;
		
		private var _rotation:Number = 0;
		private var _position:Vector2 = new Vector2();
		private var _motion:Vector2 = new Vector2();
		//private var _dimensions:Vector2 = new Vector2();
		public var radius:Number;
		public var type:int;
		
		public function get position():Vector2
		{
			return _position;//.clone();
		}
		
		public function get rotation():Number
		{
			return _rotation;
		}
		
		public function get scale():Vector2
		{
			return new Vector2(1, 1);
		}
		
		public function get bounds():Rectangle
		{
			//TODO implement.
			return new Rectangle();
		}
		
		public function set position(value:Vector2):void
		{
			//set memberwise equality, not ref equality
			 _position.x = value.x;
			 _position.y = value.y;
		}

		public function set scale(value:Vector2):void
		{
			//_scale = value.clone();
		}

		public function set rotation(value:Number):void
		{
			_rotation = value;
		}
		
		public function set motion(value:Vector2):void
		{
			_motion.x = value.x;
			_motion.y = value.y;
		}
		
		public function get motion():Vector2
		{
			return _motion;//.clone();
		}
		/*
		public function get dimensions():Vector3
		{
			return new Vector3(_radius * 2, _radius * 2, 0);
		}
		/*
		public function get aabb():Cuboid
		{
			return new Cuboid(_position.x, _position.y, 0,
				_dimensions.x, _dimensions.y, 0);
		}
		*/

	}
}